class kyo {
    static int a = 100;
    public kyo () {
        System.out.printf("6. kyo init...!\n");
    }

    {
        System.out.printf("4. kyo init block...!\n");
    }

    {
        System.out.printf("5. kyo init block...!\n");
    }

    static {
        System.out.printf("3. kyo static block...!\n");
        a = 678;
    }
}

public class StaticTest {
    static {
        // 只要使用了此类, 就会触发执行此代码块，只执行一次
        System.out.printf("1. main static block...!\n");
    }

    {
        //必须实例化时在构造方法之前执行
        System.out.printf("main init block...!\n");
    }

    static public void main(String [] args) {
        System.out.printf("2. man function run...!\n");
        // StaticTest obj = new StaticTest();
        kyo o = new kyo();
        // kyo v = new kyo();
        // System.out.printf("kyo.a = %d\n", kyo.a);
    }
}
